import java.util.Scanner;

public class 春游 {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        int q = in.nextInt();
        while(q-- > 0){
            //用long测试用例可能会溢出
            long n = in.nextLong();
            long a = in.nextLong();
            long b = in.nextLong();
            long sum = 0;
            //排除边界情况
            if(n <= 2){
                System.out.println(Math.min(a,b));
                continue;
            }
            //判断单个人单价选择塞2人还是3人
            if(3 * a < 2 * b){
                //所有人能塞多少个2人船
                long cur = n / 2;
                sum += cur * a;
                if(n % 2 == 1){
                    //如果剩一个看看能不能和前面拼
                    sum += Math.min(a,b - a);
                }
                System.out.println(sum);
            }else{
                long cur = n / 3;
                sum += cur * b;
                //同理与前面拼, 列举出所有情况
                if(n % 3 == 1){
                    sum += Math.min(a,Math.min(b,2 * a - b));
                }else if(n % 3 == 2){
                    sum += Math.min(a,Math.min(b,3 * a - b));
                }
                System.out.println(sum);

            }
        }
    }
}
